<template>
    <!-- 
    <b-modal ref="my-modal" hide-footer title="Using Component Methods">
     <div class="d-block text-center">
       <h3>Hello From My Modal!</h3>
     </div>
     <b-button class="mt-3" variant="outline-danger" block @click="hideModal">Close Me</b-button>
     <b-button class="mt-2" variant="outline-warning" block @click="toggleModal">Toggle Me</b-button>
   </b-modal> 
    -->
    <!--
        body-class="modalStyle" 表示样式
        size="lg" 表示模态窗口大小 xl,lg,sm,full
        hide-footer 表示隐藏底部按钮
        hide-header 表示隐藏头部内容
        no-close-on-backdrop 表示鼠标点击背景不可关闭
        hide-header-close 表示隐藏头部关闭按钮
        centered 居中
        ok-title=“确定” 
        cancel-title=取消
        @ok="handleOk" 
        @cancel="handleCancel"
        scrollable 滚动条
        hide-backdrop 隐藏背景
        wrapClassName="ant-modal-cust-warp" 
        style="top:5%;height: 85%;overflow-y: hidden" 样式
    -->
    <b-modal ref="my-modal" title="按钮详情" size="lg" hide-footer scrollable no-close-on-backdrop>
        <div class="d-block text-center">
            <!--begin::div-->
            <div class="m-form m-form--fit m-form--label-align-left m-form--group-seperator-dashed">
                <div class="m-portlet__body">
                </div>
                <div class="form-group m-form__group row">
                    <label class="col-md-2 col-form-label">标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;签</label>
                    <div class="col-md-2">
                        <input class="form-control" type="text" disabled maxlength="60" v-model="lcBtnForm.label_" placeholder="请输入">
                    </div>
                </div>
                <div class="form-group m-form__group row">
                    <label class="col-md-2 col-form-label">元素编号</label>
                    <div class="col-md-2">
                        <input class="form-control" type="text" disabled maxlength="32" v-model="lcBtnForm.elementId"
                            placeholder="请输入">
                    </div>
                </div>
                <div class="form-group m-form__group row">
                    <label class="col-md-2 col-form-label">元素名称</label>
                    <div class="col-md-2">
                        <input class="form-control" type="text" disabled maxlength="32" v-model="lcBtnForm.elementName"
                            placeholder="请输入">
                    </div>
                </div>
                <div class="form-group m-form__group row">
                    <label class="col-md-2 col-form-label">样&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;式</label>
                    <div class="col-md-3">
                        <input class="form-control" type="text" disabled maxlength="255" v-model="lcBtnForm.elementClass"
                            placeholder="请输入">
                    </div>
                </div>
                <div class="form-group m-form__group row">
                    <label class="col-md-2 col-form-label">图&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;标</label>
                    <div class="col-md-3">
                        <input class="form-control" type="text" disabled maxlength="255" v-model="lcBtnForm.icons" placeholder="请输入">
                    </div>
                </div>
                <div class="form-group m-form__group row">
                    <label class="col-md-2 col-form-label">提&nbsp;&nbsp;示&nbsp;语</label>
                    <div class="col-md-3">
                        <input class="form-control" type="text" disabled maxlength="255" v-model="lcBtnForm.tips" placeholder="请输入">
                    </div>
                </div>
                <div class="form-group m-form__group row">
                    <label class="col-md-2 col-form-label">动&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;作</label>
                    <div class="col-md-3">
                        <input class="form-control" type="text" disabled maxlength="255" v-model="lcBtnForm.action_"
                            placeholder="请输入">
                    </div>
                </div>
                <div class="form-group m-form__group row">
                    <label class="col-md-2 col-form-label">排&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;序</label>
                    <div class="col-md-2">
                        <el-input-number 
                            v-model="lcBtnForm.sort_" 
                            maxlength="10" 
                            disabled
                            style="width:100px;" 
                            controls-position="right"
                             :min="0" 
                             :max="9999">
                            </el-input-number>
                    </div>
                </div>
                <div class="form-group m-form__group row">
                    <label class="col-md-2 col-form-label">行为编码</label>
                    <div class="col-md-2">
                        <input class="form-control" type="text" disabled maxlength="4" v-model="lcBtnForm.behavior"  placeholder="请输入">
                    </div>
                </div>
                <div class="form-group m-form__group row">
                    <label class="col-md-2 col-form-label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
                    <div class="col-md-6">
                        <textarea class="form-control" rows="10" disabled maxlength="800" v-model="lcBtnForm.remark"
                            placeholder="请输入"></textarea>
                    </div>
                </div>
                <div class="form-group m-form__group row">
                    <label class="col-md-2 col-form-label">脚&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;本</label>
                    <div class="col-md-6">
                        <textarea class="form-control" rows="10" disabled maxlength="1024" v-model="lcBtnForm.script_"
                            placeholder="请输入"></textarea>
                    </div>
                </div>
                <div class="form-group m-form__group row">
                    <label class="col-md-2 col-form-label">扩展属性</label>
                    <div class="col-md-6">
                        <textarea class="form-control" rows="10" disabled maxlength="45" v-model="lcBtnForm.attr"
                            placeholder="请输入"></textarea>
                    </div>
                </div>
            </div>
        </div>
        <template slot="modal-footer">
            <!--自定义按钮-->
        </template>
    </b-modal>
</template>
<script>
import apiUtil from "@/core/util/apiUtil.js";
import { handleNotify, handleAlert, handleConfirm, showWating, closeWating } from "@/core/util/jehcUtil.js";
export default {
    data() {
        return {
            lcBtnForm: {
                id:"",
                label_: "",
                elementId: "",
                elementName: "",
                elementClass: "",
                icons: "",
                tips: "",
                action_: "",
                sort_: "",
                behavior: "",
                remark: "",
                script_: "",
                attr: "",
            }
        }
    },
    components: {

    },
    watch: {
    },
    mounted() {

    },
    methods: {
        
        showModal(id) {
            this.restForm();
            this.$refs['my-modal'].show();
            this.getDetail(id)
        },
        hideModal() {
            this.$refs['my-modal'].hide()
        },
        toggleModal() {
            // 当模态已隐藏时，我们传递要返回焦点的按钮的ID
            this.$refs['my-modal'].toggle('#toggle-btn')
        },
        restForm() {
            //重置
            Object.assign(this.$data.lcBtnForm, this.$options.data().lcBtnForm);
        },
        getDetail(id){
            apiUtil.get(process.env.VUE_APP_WORKFLOW_API+"/lcBtn/get/"+id).then(({ data }) => {
                this.lcBtnForm = data.data;
            });
        },
    }
}
</script>